package edu.hawaii.myisern.action;


import java.io.IOException;
import java.net.MalformedURLException;
import junit.framework.TestCase;
import org.junit.Test;
import org.xml.sax.SAXException;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebResponse;

/**
 * Tests the MyIsernAction Bean class.
 * 
 * @author Sonwright M. Gomez
 *
 */
public class TestMyIsernActionBean extends TestCase {
  /** Get the test host. */
  private String testHost = System.getProperty("test.host");

  /**
   * Tests the Index action action bean.
   * 
   * @throws SAXException if error occurs with xml parser.
   * @throws MalformedURLException if error occurs with URL.
   * @throws IOException if error occurs with IO.
   */
  @Test
  public void testgetsetMethods() throws SAXException, MalformedURLException, IOException {
    WebConversation conversation = new WebConversation();

    String pageTitle = "MyIsern - Add Collaboration";

    String Url = testHost + "myisern-1-red/addCollaboration.jsp";
    WebResponse response = conversation.getResponse(Url);
    assertNotSame("Checking addCollaboration.jsp retrieval", pageTitle, response.getTitle());
    
    MyIsernActionBean miab = new MyIsernActionBean();
    miab.setContext(null);
    assertNull("context is null", miab.getContext());
  }
}
